package com.first.order.controller;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.first.common.pojo.Order;
import com.first.common.vo.Result;
import com.first.order.service.OrderService;
import com.first.order.vo.OrderVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
/**
 * @program: SecondProject
 * @description:
 * @author: 李榕轩
 * @create: 2023-06-06 15:20
 **/
@RestController
@RequestMapping("order/order")
@Api(tags = "前台订单接口")
public class QianOrderQueryAllController {
    @Autowired
    private OrderService orderService;
    @PostMapping("/getAllOrders/{currentPage}/{pageSize}")
    @ApiOperation(value = "条件查询")
    public Result queryMemberStatus(@PathVariable Integer currentPage, @PathVariable Integer pageSize, @RequestBody OrderVo orderVo) {
        //System.out.println(userVo);
        Page<Order> orderPage = orderService.findByPage(currentPage, pageSize, orderVo);
        return Result.success(orderPage);
    }
    @DeleteMapping("/deleteOrder/{id}")
    @ApiOperation(value = "条件查询")
    public Result deleteOrder(@PathVariable String id) {
        //System.out.println(userVo);
        Integer integer = orderService.deleteOrder(id);
        return Result.success(integer);
    }
}
